//
// Created by Administrator on 2023/7/28.
//
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;

class Solution {
public:
    int maximumValue(vector<string> &strs) {
        int maxNum = 0;
        for (string &word: strs) {
            // 判断是不是纯数字
//            if (isNumber(word)) {
//                maxNum = max(maxNum, stoi(word));
//            } else
//                maxNum = max(maxNum, int(word.size()));
            maxNum = max(maxNum, isNumber(word) ? stoi(word) : int(word.size()));
        }
        return maxNum;
    }

    bool isNumber(const string &str) {
//        for (char const &c: str) {
//            if (isdigit(c) == 0) return false;
//        }
//        return true;
        return all_of(str.begin(), str.end(),
                      [](char c) { return isdigit(c) != 0; });
    }

};

class Solution2 {
public:
    int maximumValue(vector<string> &strs) {
        int res = 0;
        for (auto &s: strs) {
            bool isDigits = true;
            for (char &c: s) {
                isDigits &= isdigit(c);
            }
            res = max(res, isDigits ? stoi(s) : (int) s.size());
        }
        return res;
    }
};

int main() {
    vector<string> strs{"alic3", "bob", "3", "4", "00000"};
    Solution s;
    cout << s.maximumValue(strs) << endl;
}